/*
 * @Description: 页面标题组件
 * @Author: Rfan
 * @Date: 2022-03-31 14:27:10
 * @LastEditTime: 2022-04-05 20:00:51
 */

import { Button } from 'antd';
import classNames from 'classnames/bind';
import { useRoleContext } from '../contexts/RoleContext';
import styles from '../styles/main.module.scss';

const cx = classNames.bind(styles);

const MainTitle = () => {
  const { showAddDialog } = useRoleContext();

  return (
    <div className={cx('main-title')}>
      <h4>角色管理</h4>
      <div>
        <Button
          type="primary"
          onClick={() => {
            showAddDialog();
          }}
        >
          创建角色
        </Button>
      </div>
    </div>
  );
};

export default MainTitle;
